<link href="/css/home/warehouse.css" media="screen" rel="stylesheet" type="text/css">
<style type="text/css">
    .datatable {
            width:1020px;
            text-align: left;
            font-size: 12px;
            font-family: verdana;
            background: #c0c0c0;
    }

    .datatable thead tr,

    .datatable tfoot tr {
            background: #c0c0c0;
    }

    .datatable tbody tr {
            background: #f0f0f0;
            height: 16px;
    }

    .datatable td, .datatable th {
            border: 1px solid white; height:28px;
    }
    .datatable td {background-color:white;}

    .datatable .hover td {background-color:#99CCFF;}

    .datatable .select td {background-color:#EEEE99;}
    
    table{border-collapse:collapse;}
</style>
<table width="1020px" class="datatable" border="0" cellpadding="0" cellspacing="0" id="table">
              <tr align="center">
                  <td style="width:150px;background-color:#555555;height:36px;"><font color="#FFFFFF">条形码</font></td>
                  <td style="width:300px;background-color:#666666;"><font color="#FFFFFF">商品名称</font></td>
                  <td style="width:100px;background-color:#555555;"><font color="#FFFFFF">商品类型</font></td>
                  <td style="width:100px;background-color:#666666;"><font color="#FFFFFF">商品净重</font></td>
                  <td style="width:100px;background-color:#555555;"><font color="#FFFFFF">状态</font></td>
              </tr>
                        <?php if($this->storelist != ''){
                            foreach ($this->storelist as $Item) {
                        ?>
                        <tr align="center">
                            <td style="background-color:#C4C4C4;height:36px;"><?php echo $Item->barcode; ?><br><?php echo $Item->dateInStore; ?></td>
                            <td align="left" style="background-color:#E5E5E5;">&nbsp;&nbsp;<a href="/admini/managestore/storedetail/id/<?php echo $Item->id; ?>" style="color:#00f;" target="_blank"><?php echo strlen($Item->productName)>=20?mb_substr($Item->productName,0,15, 'utf-8').'...':$Item->productName;?></a></td>
                            <td style="background-color:#C4C4C4;"><?php
                                    $itemTypeStr = '';
                                    switch ($Item->itemType) {
                                        case 0:
                                            $itemTypeStr = '正常';
                                            break;
                                        case 1:
                                            $itemTypeStr = '仿牌';
                                            break;
                                        case 2:
                                            $itemTypeStr = '电池';
                                            break;
                                        case 4:
                                            $itemTypeStr = '液体';
                                            break;
                                        case 8:
                                            $itemTypeStr = '食品';
                                            break;
                                        case 16:
                                            $itemTypeStr = '粉末';
                                            break;
                                        case 32:
                                            $itemTypeStr = '膏状物';
                                            break;
                                        case 64:
                                            $itemTypeStr = '药物';
                                            break;
                                        default :
                                             $itemTypeStr = '其他';
                                            break;
                                    }
                                    echo $itemTypeStr;
                                    ?></td>
                            <td style="background-color:#E5E5E5;"><?php echo $Item->weight; ?>g</td>
                            <td style="background-color:#C4C4C4;"><?php $stateStr = '';
                                    if ($Item->state == 1 && $Item->wayId != '') {
                                        $stateStr = '等待出库';
                                    } else if ($Item->state == 1) {
                                        $stateStr = '入库';
                                    } else if ($Item->state == 2) {
                                        $stateStr = '出库';
                                    }
                                    echo $stateStr;?></td>
                            </tr>   
                        <?php }}?>
                         <tr>
                            <td colspan="5" align="right">
                                <div class="toolbar" style="height: 35px;padding-top: 0px;">
                                    <?php echo $this->partial('paging.phtml', array("pages" => $this->storeall)); ?>
                                </div>
                            </td>
                        </tr>
                    </table>